from selenium.webdriver.common.by import By


class AdminDashboardsLocator:
    # Customer Resource页面tab
    customer_resource_tab = (By.CSS_SELECTOR, "[path='/console/dashboardReport/customerResource']")
    # Users页面tab
    users_tab = (By.CSS_SELECTOR, "[path='/console/dashboardReport/userData']")
    # User Status页面tab
    user_status_tab = (By.CSS_SELECTOR, "[path='/console/dashboardReport/activeUserData']")
    # Sales Amount页面tab
    sales_amount_tab = (By.CSS_SELECTOR, "[path='/console/dashboardReport/salesAmountData']")
    # Orders页面tab
    orders_tab = (By.CSS_SELECTOR, "[path='/console/dashboardReport/orderData']")

    # Customer Resource页面元素
    # 搜索条件开始时间
    customer_resource_start_time_input = (By.CSS_SELECTOR, "input#date")
    # 搜索条件结束时间
    customer_resource_end_time_input = (By.XPATH, "//input[@placeholder='End date']")
    # 搜索条件关键词
    customer_resource_keyword_input = (By.XPATH, "//input[contains(@class, 'antd4-input')]")
    # 搜索按钮
    customer_resource_search_button = (By.XPATH, "//button[contains(@class, 'antd4-input-search-button')]")
    # 表格数据行
    customer_resource_table_rows = (By.XPATH, "//tr[contains(@class,'antd4-table-row antd4-table-row-level-0')]")

    # Users/User Status/Sales Amount/Orders页面通用元素
    # loading动画
    loading_anime = (By.XPATH, "//span[contains(@class, 'antd4-spin-dot-spin')]")
    # 日期选择器
    date_as_of_time_selector_input = (By.XPATH, "//div[contains(@class, 'antd4-picker antd4-picker-status-success')]//input")
    # 日期区间选择器
    date_between_time_selector_start_input = (By.XPATH, "//input[@placeholder='Start date']")
    date_between_time_selector_end_input = (By.XPATH, "//input[@placeholder='End date']")

    # Users页面元素
    # 报表Date字段
    users_table_col_date = (By.XPATH, "//thead[contains(@class, 'antd4-table-thead')]//th[1]")

    # User Status页面元素
    # 报表Date字段
    user_status_table_col_date = (By.XPATH, "(//thead[contains(@class, 'antd4-table-thead')])[2]//th[1]")

    # Sales Amount页面元素
    # 报表Date字段
    sales_amount_table_col_date = (By.XPATH, "//thead[contains(@class, 'antd4-table-thead')]//th[1]")

    # Orders页面元素
    # 报表Date字段
    orders_table_col_date = (By.XPATH, "//thead[contains(@class, 'antd4-table-thead')]//th[1]")
